# -*- coding: utf-8 -*-
# standard
import os
import sys
from datetime import datetime

# third

# local
_P_PATH =  os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if _P_PATH not in sys.path:
    sys.path.append(_P_PATH)
begin = datetime.now()
from models.iot_model import *
from models.influxdb_model import *
print(f"加载models耗时：{(datetime.now() - begin).total_seconds()}")


"""
@Title:   模型定义
@File: __init__.py
@Author: walle 2024年03日06日 15时36分37秒
@Version: 1.0.0
@Desc: 
"""


# Base.metadata.tables['product'].drop(engine)
# Base.metadata.tables['network_access_mode'].drop(engine)

print(1)
Base.metadata.create_all(bind=engine)
print(2)
InFluxDBAlertOrm.init_alert_cache()
print(3)


if __name__ == '__main__':
    InFluxDBAlertOrm.simple_repair_priority()
    pass